import axios from '@/common/axios';
import { API_URL } from '@/common/constants';

export const doLogin = async (json) => {
  const { data } = await axios.post(`${API_URL}user/login`, json);
  return data;
};

export const getUserInfo = async (userId) => {
  const { data } = await axios.get(`${API_URL}cSecUserApi/queryUser/${userId}`);
  return data;
};

export const logout = async () => {
  const { data } = await axios.get(`${API_URL}cSecUserApi/logout`);
  return data;
};

export const updateUserNameAndPassword = async (json) => {
  const { data } = await axios.post(`${API_URL}cSecUserApi/updateUserNameAndPassword`, json);
  return data;
};
